const merge = require('webpack-merge')
const common = require('./webpack.common.js')

const path = require('path')
const webpack = require('webpack')


module.exports = merge(common, {
    mode: 'development',
    optimization: {
        usedExports: true
    },

    // webpack-dev-server 配置项
    devServer: {
        port: 3000, // 端口号
        contentBase: path.resolve('./src'), // 根路径
        open: true, // 运行完成后在浏览器中自动打开
        hot: true // 热更新，第一步，第二步 见下面的 plugins
    },
    // 插件
    plugins: [
        // 热更新，第二步
        new webpack.HotModuleReplacementPlugin()
    ]
})
